
package com.work.mvc.view.panels;

import com.vaadin.ui.Component;

public class ContentFactory {

	private static ContentFactory contentFactory = null;

	protected ContentFactory() {}

	public static ContentFactory getInstance()
	{
		if (contentFactory == null) {
			contentFactory = new ContentFactory();
		}
		return contentFactory;
	}

	public Component createContent(ContentPanelsEnum contentEnum)
	{
		Component content = null;
		
		switch (contentEnum)
		{
			case WORKTIME_PANEL :
				content = new WorkTimeView();
				break;
			case REPORT_OVERTIME_PANEL :
				content = new OverTimeReportView();
				break;
			case REPORT_LEAVE_PANEL :
				content = new LeaveReportView();
				break;
			default :
				break;
		}
		
		return content;
	}
}
